﻿using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FDEE.Model
{
    /// <summary>
    /// 盖梁基类
    /// </summary>
    public abstract class CrossbeamBase : MemberBase
    {
        public double Width,LeftWidth; // 总宽度，左侧总宽度
        public int L1, L2; //隐形盖梁 底宽=L1,顶宽=L2(非隐形盖梁L2=0)
        public int CalculatedHeight, Height; // 盖梁计算高度，总高度（非隐形盖梁时两者相等）
        public RebarTendonDistribute TendonDistribute; // 预应力顺桥向分布

        protected CrossbeamBase(string typeName, string pierNumber, 
            int height, double width,double leftwidth, int calculatedHeight,int l1,int l2):
            base(typeName,pierNumber)
        {
            Height = height;
            Width = width;
            CalculatedHeight = calculatedHeight;
            L1 = l1;
            L2 = l2;
            LeftWidth = leftwidth;
        }
        /// <summary>
        /// 混凝土强度设置
        /// </summary>
        public override void SetConcreteClass()
        {
            ConcreteClass = eConcreteClass.C45;
        }
        /// <summary>
        /// 预应力纵向布置
        /// </summary>
        public abstract void SetTendonList(ref System.Data.DataTable dt);

    }

    public abstract class BPTMBase : CrossbeamBase
    {
        public int Span;
        public TendonCollection TendonList;

        protected BPTMBase(string typeName, string pierNumber, 
            int height, double width,double leftwidth, int calculatedHeight,int L1,int L2,int span) :
            base(typeName, pierNumber, height, width,leftwidth, calculatedHeight,L1,L2)
        {
            Span = span;
            TendonList = new TendonCollection();
        }

        public override void SetConcreteVolume()
        {
            int A =(int)( L1 * 0.001 * CalculatedHeight * 0.001 + L2 * 0.001 * (Height - CalculatedHeight) * 0.001);
            int A2 = (int)(L1 * 0.001 * Height * 0.001);
            ConcreteVolumn = (Width-400)*0.001 * A  + 400 * 0.001 * A2 ;
        }
    }

}
